import Vue from "vue";
import VueRouter from "vue-router";
import HomeView from "../views/HomeView.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "home",
    component: HomeView,
  },
  // 首页
  {
    path: "/index",
    name: "index",
    component: () => import("../views/Index.vue"),
  },
  // 地图
  {
    path: "/map",
    name: "map",
    component: () => import("../views/MapContainer.vue"),
  },
  // 登录
  {
    path: "/sign",
    name: "sign",
    component: () => import("../views/Mobile/user/Sign.vue"),
  },
  // 注册
  {
    path: "/register",
    name: "register",
    component: () => import("../views/Mobile/user/Register.vue"),
  },
  // 个人
  {
    path: "/personal",
    name: "personal",
    component: () => import("../views/Mobile/user/personal.vue"),
  },
  // 修改
  {
    path: "/modify",
    name: "modify",
    component: () => import("../views/Mobile/user/Modify.vue"),
  },
  // 答题
  {
    path: "/answer",
    name: "answer",
    component: () => import("../views/Mobile/user/Answer.vue"),
  },
  // 申请
  {
    path: "/apply",
    name: "apply",
    component: () => import("../views/Mobile/user/Apply.vue"),
  },
  // 收藏
  {
    path: "/collection",
    name: "Collection",
    component: () => import("../views/Mobile/user/Collection.vue"),
  },

  // 关于可可西里
  {
    path: "/aboutkkxl",
    name: "aboutkkxl",
    component: () => import("../views/aboutKKXL/aboutKKXL.vue"),
  },
  // 山水
  {
    path: "/shanshui",
    name: "shanshui",
    component: () => import("../views/shanshui/shanShui.vue"),
  },
  // 巴颜喀拉山脉详情
  {
    path: "/bayankala",
    name: "bayankala",
    component: () => import("../views/shanshui/bayYanKaLa.vue"),
  },
  // 茶卡盐湖详情
  {
    path: "/chakayanhu",
    name: "chakayanhu",
    component: () => import("../views/shanshui/chaKaYanHu.vue"),
  },
  // 倒淌河详情
  {
    path: "/daotanghe",
    name: "daotanghe",
    component: () => import("../views/shanshui/daoTangHe.vue"),
  },
  // 都兰古墓群详情
  {
    path: "/dulangumu",
    name: "dulangumu",
    component: () => import("../views/shanshui/duLanGuMu.vue"),
  },
  // 湟源峡详情
  {
    path: "/huangyuanxia",
    name: "huangyuanxia",
    component: () => import("../views/shanshui/huangYuanXia.vue"),
  },
  // 金银滩详情
  {
    path: "/jinyintan",
    name: "jinyintan",
    component: () => import("../views/shanshui/jinYinTan.vue"),
  },
  // 牛头碑详情
  {
    path: "/niutoubei",
    name: "niutoubei",
    component: () => import("../views/shanshui/niuTouBei.vue"),
  },
  // 青海湖详情
  {
    path: "/qinghaihu",
    name: "qinghaihu",
    component: () => import("../views/shanshui/qingHaiHu.vue"),
  },
  // 日月山详情
  {
    path: "/riyueshan",
    name: "riyueshan",
    component: () => import("../views/shanshui/riYueShan.vue"),
  },
  // 扎陵湖和鄂陵湖详情
  {
    path: "/zhalinghu",
    name: "zhalinghu",
    component: () => import("../views/shanshui/zhaLingHu.vue"),
  },

  // 探索
  {
    path: "/explore",
    name: "explore",
    component: () => import("../views/Mobile/explore/Explore.vue"),
  },
  // 探索
  {
    path: "/destinatio",
    name: "destinatio",
    component: () => import("../views/Mobile/explore/Destinatio.vue"),
  },
  // 路线
  {
    path: "/route",
    name: "route",
    component: () => import("../views/Mobile/explore/Route.vue"),
  },
  // 详细路线
  {
    path: "/detailed-route/:type_id",
    name: "detailed-route",
    component: () => import("../views/Mobile/explore/DetailedRoute.vue"),
  },
  // 旅行
  {
    path: "/travel",
    name: "travel",
    component: () => import("../views/Mobile/explore/Travel.vue"),
  },
  // 指南
  {
    path: "/guide",
    name: "guide",
    component: () => import("../views/Mobile/explore/Guide.vue"),
  },
  // 分享
  {
    path: "/share",
    name: "share",
    component: () => import("../views/Mobile/explore/Share.vue"),
  },
  //我的分享
  {
    path: "/my-share",
    name: "my-share",
    component: () => import("../views/Mobile/explore/MyShare.vue"),
  },
  // 关于可可西里
  {
    path: "/aboutkkxl",
    name: "aboutkkxl",
    component: () => import("../views/aboutKKXL/aboutKKXL.vue"),
  },
  // 山水
  {
    path: "/shanshui",
    name: "shanshui",
    component: () => import("../views/shanshui/shanShui.vue"),
  },
  // 巴颜喀拉山脉详情
  {
    path: "/bayankala",
    name: "bayankala",
    component: () => import("../views/shanshui/bayYanKaLa.vue"),
  },
  // 茶卡盐湖详情
  {
    path: "/chakayanhu",
    name: "chakayanhu",
    component: () => import("../views/shanshui/chaKaYanHu.vue"),
  },
  // 倒淌河详情
  {
    path: "/daotanghe",
    name: "daotanghe",
    component: () => import("../views/shanshui/daoTangHe.vue"),
  },
  // 都兰古墓群详情
  {
    path: "/dulangumu",
    name: "dulangumu",
    component: () => import("../views/shanshui/duLanGuMu.vue"),
  },
  // 湟源峡详情
  {
    path: "/huangyuanxia",
    name: "huangyuanxia",
    component: () => import("../views/shanshui/huangYuanXia.vue"),
  },
  // 金银滩详情
  {
    path: "/jinyintan",
    name: "jinyintan",
    component: () => import("../views/shanshui/jinYinTan.vue"),
  },
  // 牛头碑详情
  {
    path: "/niutoubei",
    name: "niutoubei",
    component: () => import("../views/shanshui/niuTouBei.vue"),
  },
  // 青海湖详情
  {
    path: "/qinghaihu",
    name: "qinghaihu",
    component: () => import("../views/shanshui/qingHaiHu.vue"),
  },
  // 日月山详情
  {
    path: "/riyueshan",
    name: "riyueshan",
    component: () => import("../views/shanshui/riYueShan.vue"),
  },
  // 扎陵湖和鄂陵湖详情
  {
    path: "/zhalinghu",
    name: "zhalinghu",
    component: () => import("../views/shanshui/zhaLingHu.vue"),
  },
  // 条理
  {
    path: "/travel",
    name: "travel",
    component: () => import("../views/Mobile/explore/Travel.vue"),
  },

  {
    path: "/about",
    name: "about",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.

    component: () =>
      import(/* webpackChunkName: "about" */ "../views/AboutView.vue"),
  },
  //后台管理
  {
    path: "/htlogin",
    name: "htlogin",
    component: () => import("../views/HtLogin/Home.vue"),
    children: [
      {
        path: "index",
        name: "/htlogin/index",
        component: () => import("../views/HtLogin/Index.vue"),
      },
      {
        path: "jqlist",
        name: "/htlogin/jqlist",
        component: () => import("../views/HtLogin/jq/jqList.vue"),
      },
      {
        path: "jqadd",
        name: "/htlogin/jqadd",
        component: () => import("../views/HtLogin/jq/jqAdd.vue"),
      },
      // 用户列表
      {
        path: "userlist",
        name: "/htlogin/userlist",
        component: () => import("../views/HtLogin/user/userList.vue"),
        meta: {
          keepAlive: true,
        },
      },
      // 新增用户
      {
        path: "user-add",
        name: "/htlogin/user-add",
        component: () => import("../views/HtLogin/user/userAdd.vue"),
      },
      // 用户详情
      {
        path: "user-details/:id",
        name: "/htlogin/user-details",
        component: () => import("../views/HtLogin/user/userdetails.vue"),
      },
      // 用户-申请表
      {
        path: "sqb-user-details/:id",
        name: "/htlogin/sqb-user-details",
        component: () => import("../views/HtLogin/user/sqbUserDetails.vue"),
      },
      // 申请表
      {
        path: "sqblist",
        name: "/htlogin/sqblist",
        component: () => import("../views/HtLogin/user/sqbList.vue"),
      },
      // 申请表详情
      {
        path: "sqb-details/:id",
        name: "/htlogin/sqb-details",
        component: () => import("../views/HtLogin/user/sqbDetails.vue"),
      },
      {
        path: "tllist",
        name: "/htlogin/tllist",
        component: () => import("../views/HtLogin/tl/tlList.vue"),
      },
      {
        path: "tladd",
        name: "/htlogin/tladd",
        component: () => import("../views/HtLogin/tl/tiAdd.vue"),
      },
      {
        path: "tklist",
        name: "/htlogin/tklist",
        component: () => import("../views/HtLogin/tk/tkList.vue"),
      },
      {
        path: "tkadd",
        name: "/htlogin/tkadd",
        component: () => import("../views/HtLogin/tk/tkAdd.vue"),
      },
    ],
  },
  //后台管理
  {
    path: "/htlogin",
    name: "htlogin",
    component: () => import("../views/HtLogin/Home.vue"),
    children:[{
      path:'index',
      name:'/htlogin/index',
      component: () => import('../views/HtLogin/Index.vue')
    },
    {
      path:'jqlist',
      name:'/htlogin/jqlist',
      component: () => import('../views/HtLogin/jq/jqList.vue')
    },
    {
      path:'jqadd',
      name:'/htlogin/jqadd',
      component: () => import('../views/HtLogin/jq/jqAdd.vue')
    },
    {
      path:'userlist',
      name:'/htlogin/userlist',
      component: () => import('../views/HtLogin/user/userList.vue')
    },
    {
      path:'sqblist',
      name:'/htlogin/sqblist',
      component: () => import('../views/HtLogin/user/sqbList.vue')
    },
    {
      path:'tllist',
      name:'/htlogin/tllist',
      component: () => import('../views/HtLogin/tl/tlList.vue')
    },
    {
      path:'tladd',
      name:'/htlogin/tladd',
      component: () => import('../views/HtLogin/tl/tiAdd.vue')
    },
    {
      path:'tklist',
      name:'/htlogin/tklist',
      component: () => import('../views/HtLogin/tk/tkList.vue')
    },
    {
      path:'tkadd',
      name:'/htlogin/tkadd',
      component: () => import('../views/HtLogin/tk/tkAdd.vue')
    }]
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
